package a.j.a;

import a.c.bb;
import a.c.e;
import a.c.q;
import a.c.w;
import a.j.g;

import javax.swing.*;
import javax.swing.tree.TreePath;
import java.awt.datatransfer.DataFlavor;
import java.awt.datatransfer.Transferable;
import java.awt.datatransfer.UnsupportedFlavorException;
import java.io.IOException;

public class s
  extends TransferHandler
{
  private j a;
  public static boolean b;
  
  public s(j paramj)
  {
    this.a = paramj;
  }
  
  protected Transferable createTransferable(JComponent paramJComponent)
  {
    JTree localJTree = (JTree)paramJComponent;
    TreePath[] arrayOfTreePath = localJTree.getSelectionPaths();
    return new a_(arrayOfTreePath);
  }
  
  public int getSourceActions(JComponent paramJComponent)
  {
    return 2;
  }
  
  public boolean importData(JComponent paramJComponent, Transferable paramTransferable)
  {
    int j = j.v;
    boolean bool = j.u;
    if (j == 0) {
      if (canImport(paramJComponent, paramTransferable.getTransferDataFlavors())) {
        try
        {
          TreePath[] arrayOfTreePath = (TreePath[])paramTransferable.getTransferData(a_.c);
          JTree localJTree = (JTree)paramJComponent;
          TreePath localTreePath = localJTree.getSelectionPath();
          if (j == 0)
          {
            if (localTreePath != null)
            {
              bb localbb = new bb();
              int i = 0;
              Object localObject2;
              do
              {
                if (i >= arrayOfTreePath.length) {
                  break;
                }
                localObject2 = arrayOfTreePath[i].getLastPathComponent();
                if (bool) {
                  break label281;
                }
                if ((localObject2 instanceof e)) {
                  localbb.add(localObject2);
                }
                i++;
              } while (!bool);
              Object localObject1 = localTreePath.getLastPathComponent();
              if (j != 0) {
                break label281;
              }
              if (j == 0) {
                if ((localObject1 instanceof e))
                {
                  localObject2 = (e)localObject1;
                  if (j == 0)
                  {
                    if (this.a.n((e)localObject2))
                    {
                      e locale = this.a.p((e)localObject2);
                      if (j == 0) {
                        if (locale == null)
                        {
                          localObject1 = ((e)localObject2).g();
                          if (j != 0) {
                            break label227;
                          }
                          if (!bool) {
                            break label213;
                          }
                        }
                      }
                      localObject2 = locale;
                    }
                    label213:
                    if (j != 0) {
                      break label251;
                    }
                  }
                  if (!this.a.l((e)localObject2))
                  {
                    label227:
                    if (j != 0) {
                      break label263;
                    }
                    if (!this.a.m((e)localObject2)) {}
                  }
                  else
                  {
                    label251:
                    this.a.b(localbb, (e)localObject2);
                  }
                }
              }
              if ((localObject1 instanceof q)) {
                label263:
                this.a.b(localbb, null);
              }
            }
            a();
          }
          label281:
          return true;
        }
        catch (UnsupportedFlavorException localUnsupportedFlavorException) {}catch (IOException localIOException) {}
      }
    }
    return false;
  }
  
  private void a()
  {
    boolean bool = j.u;
    g localg = (g)this.a.j();
    localg.gb();
    bb localbb = this.a.a(this.a.j(), true);
    w localw = localbb.l();
    do
    {
      if (!localw.e()) {
        break;
      }
      e locale = localw.d();
      localg = (g)this.a.o(locale);
      localg.gb();
      localw.f();
    } while (!bool);
  }
  
  public boolean canImport(JComponent paramJComponent, DataFlavor[] paramArrayOfDataFlavor)
  {
    int j = j.v;
    boolean bool = j.u;
    do
    {
      for (int i = 0; !bool; i++)
      {
        if (i >= paramArrayOfDataFlavor.length) {
          break;
        }
        if (bool) {
          break label51;
        }
        if (a_.c.equals(paramArrayOfDataFlavor[i])) {
          return true;
        }
      }
    } while (j != 0);
    label51:
    return false;
  }
  
  static class a_
    implements Transferable
  {
    private TreePath[] a;
    static DataFlavor c;
    
    a_(TreePath[] paramArrayOfTreePath)
    {
      this.a = paramArrayOfTreePath;
    }
    
    public DataFlavor[] getTransferDataFlavors()
    {
      return new DataFlavor[] { c };
    }
    
    public boolean isDataFlavorSupported(DataFlavor paramDataFlavor)
    {
      return c.equals(paramDataFlavor);
    }
    
    public Object getTransferData(DataFlavor paramDataFlavor)
      throws UnsupportedFlavorException, IOException
    {
      if (j.v == 0) {
        if (!c.equals(paramDataFlavor)) {
          throw new UnsupportedFlavorException(paramDataFlavor);
        }
      }
      return this.a;
    }
    
    static
    {
      try
      {
        c = new DataFlavor("application/x-java-jvm-local-objectref; class=\"" + new TreePath[0].getClass().getName() + "\"");
      }
      catch (ClassNotFoundException localClassNotFoundException)
      {
        localClassNotFoundException.printStackTrace();
      }
    }
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.j.a.s

 * JD-Core Version:    0.7.0.1

 */